import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('@/views/layout'),
    redirect: '/',
    children: [
      {
        path: '/',
        component: () => import('@/views/home/index'),
      },
      {
        path: '/qa',
        component: () => import('@/views/qa/index'),
      },
      {
        path: '/video',
        component: () => import('@/views/video/index'),
      },
      {
        path: '/my',
        component: () => import('@/views/my/index'),
      },
    ]
  },

  {
    path: '/login',
    component: () => import("@/views/login")
  },
  {
    path: '/user/profile',
    component: () => import('@/views/user/profile'),
  },

  /* search */
  {
    path: '/search',
    component: () => import('@/views/search'),
  },
  //article   /article/1333333/22
  {
    path: '/article/:articleId',
    name: 'article',
    component: () => import('@/views/article'),
    props: true
  },

  {
    path: '/slot',
    name: 'slot',
    component: () => import('@/views/slot'),

  },
  {
    path: '/slotuse',
    name: 'slotuse',
    component: () => import('@/views/slot/slotuse'),

  },
]

const router = new VueRouter({
  routes
})

export default router


